#define _CRT_SECURE_NO_WARNINGS
#include"LInkList.h"

void LinkListTest1()
{
	SListNode* plist = NULL;
	plist = BuySListNode(5);
	SListPrint(plist);
	SListPushBack(&plist, 6);
	SListPrint(plist);
	SListPushFront(&plist, 4);
	SListNode* q = SListFind(plist, 4);
	SListPrint(plist);
	//SListPopBack(&plist);
	//SListPopFront(&plist);
	//SListPrint(plist);
	q = SListFind(plist, 4);

	SListInsertAfter(q, 9);
	q = SListFind(plist, 4);
	SListEraseAfter(q);
	SListPrint(plist);
}

void LinkListTest2()
{
	SListNode* plist = NULL;
	SListPushFront(&plist, 1);
	SListPushFront(&plist, 2);
	SListPushFront(&plist, 3);
	SListPushFront(&plist, 4);
	SListPushFront(&plist, 5);
	SListPrint(plist);
	SListNode* pos = SListFind(plist ,5);
	SListInsert(&plist, pos, 7);
	SListPrint(plist);
	pos = SListFind(plist, 7);
	SListErase(&plist, pos);
	pos = NULL;
	SListPrint(plist);
	SListDestroy(&plist);

}

int main()
{
	LinkListTest2();
	return 0;
}